package com.ihr360.sharedservice.exceptionmail.dto;

import com.ihr360.commons.model.BaseEntity;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.hateoas.Identifiable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;

/**
 * Created by Eric on 18-06-07.
 */
@Entity
@Table(name = "tab_system_config")
@DynamicUpdate
public class SystemConfig extends BaseEntity implements Identifiable<String> {
    @Column(length = 64, nullable = false, unique = true)
    @Enumerated(EnumType.STRING)
    private Keys configKey;
    @Column(columnDefinition = "text")
    private String value;

    public Keys getConfigKey() {
        return configKey;
    }

    public void setConfigKey(Keys configKey) {
        this.configKey = configKey;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public enum Keys {
        EXCEPTION_NOTIFY_EMAIL("系统出现异常的时候的通知对象");

        private final String description;

        Keys(String description) {
            this.description = description;
        }

        public String getDescription() {
            return description;
        }
    }
}
